Skip to content

Added get system transaction command#1916

Merged
mfbz merged 6 commits into
masterfrom
mfbz/get-system-transaction-cmd
Apr 16, 2025
Merged

Added get system transaction command#1916
mfbz merged 6 commits into
masterfrom
mfbz/get-system-transaction-cmd

Conversation

@mfbz
Copy link
Copy Markdown
Contributor

@mfbz mfbz commented Apr 10, 2025

Closes #1871

Description

Add a new command under transactions commands to get system transaction from a block id.

Simple usage:

flow transactions get-system <blockId>

@bjartek
Copy link
Copy Markdown
Collaborator

bjartek commented Apr 10, 2025

Will there be a version that takes heigh as input parameter?

is the system tx id from the server used or from the client?

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 10, 2025

Codecov Report

Attention: Patch coverage is 72.72727% with 6 lines in your changes missing coverage. Please review.

Project coverage is 28.41%. Comparing base (a916fd7) to head (e158277).

Files with missing lines Patch % Lines
internal/transactions/get-system.go 71.42% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1916      +/-   ##
==========================================
+ Coverage   28.26%   28.41%   +0.14%     
==========================================
  Files          95       96       +1     
  Lines        6591     6613      +22     
==========================================
+ Hits         1863     1879      +16     
- Misses       4546     4550       +4     
- Partials      182      184       +2     
Flag Coverage Δ
unittests 28.41% <72.72%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mfbz
Copy link
Copy Markdown
Contributor Author

mfbz commented Apr 10, 2025

At the moment the command just replicates this: https://developers.flow.com/networks/access-onchain-data#getsystemtransaction from the specs, but i agree with you that in the future we could add a version of the command that takes the height, get the block id from it and then calls the same function under the hood.

It's using the tx id retrieved from the client as per flowkit gateway execution https://github.com/onflow/flowkit/blob/9369af2f6f4349acba550b41f27b952d8c7707e3/gateway/grpc.go#L150

@chasefleming
Copy link
Copy Markdown
Member

Do we need to introduce a new command with get-system or can we programmatically determine if its a block ID or not and just do flow transactions get <blockId>? Maybe being explicit is better, but then I wonder if it's better to do flow transactions get system:<blockId>. Curious what others think.

Comment thread internal/transactions/get-system.go Outdated
@mfbz
Copy link
Copy Markdown
Contributor Author

mfbz commented Apr 10, 2025

Added support to <block_id|latest|block_height> as argument to the command for max flexibility!

@mfbz mfbz requested a review from jribbink April 15, 2025 20:52
@mfbz mfbz merged commit 94bacb0 into master Apr 16, 2025
5 checks passed
@mfbz mfbz deleted the mfbz/get-system-transaction-cmd branch April 16, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get system transaction and result

5 participants